<link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.min.css">
<a href="{{action($controller . '@create')}}">添加</a>
<form class="form-inline" role="form" action="{{action($controller . '@index')}}">
    @foreach ($fields_show as $field => $field_info)
        @if (isset($field_info['search']))
            <div class="form-group">
                <label class="col-sm-3 control-label">{{$field_info['show']}}</label>
                <div class="col-md-3">
                    <input name="{{$field}}" type="input" class="form-control" placeholder=""
                           value="@if (isset($input[$field])){{$input[$field]}}@endif">
                </div>
            </div>
        @endif
    @endforeach
    <input type="submit" class="btn btn-success" value="查询"/>

</form>
<table class="table table-border ">
    <thead>
    <tr>
        @foreach ($fields_show as $field => $field_info)
            <th>{{$field_info['show'] OR ''}}</th>
        @endforeach
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    @foreach($models as $model)
        <tr>
            @foreach ($fields_show as $field => $field_info)
                <td>{{$model->$field OR ''}}</td>
            @endforeach
            <td>
                <a href="{{action($controller . '@edit',['id'=>$model->id])}}">修改</a>
                <a href="{{action($controller . '@destroy',['id'=>$model->id])}}">删除</a>
            </td>

        </tr>
    @endforeach
    </tbody>
</table>
